import Vue from "vue";
import VueRouter from "vue-router";
import myLogin from "@/views/myLogin";
import myReg from "@/views/myReg";
import myPage from "@/views/myPage";
import myArticle from "@/views/article/myArticle";
import mySearch from "@/views/search/mySearch";
import searchList from "@/views/search/searchList";
import myPublish from "@/views/myPublish";
import myMy from "@/views/myMy";
import User_Edit from "@/views/userInfo/User_Edit";
import Nickname_Edit from "@/views/Nickname_Edit";
import myContact from "@/views/my/myContact";
import myAbout from "@/views/my/myAbout";
import myModify from "@/views/my/myModify";
import myForget from "@/views/myForget";

Vue.use(VueRouter); //

//配置表
const routes = [
  {
    //重定向
    path: "*", //路径 必填
    name: "", //路由名字 选填
    component: myPage, //路由对应的页面
    meta: {
      keep: true,
    },

    // redirect: "page",
  },
  {
    path: "/login",
    name: "login",
    component: myLogin,
  },
  {
    path: "/reg",
    name: "reg",
    component: myReg,
  },

  {
    path: "/page",
    name: "page",
    component: myPage,
    meta: {
      keep: true,
    },
  },
  {
    path: "/search",
    name: "search",
    component: mySearch,
  },
  {
    path: "/searchlist",
    name: "searchlist",
    component: searchList,
  },
  {
    path: "/publish",
    name: "publish",
    component: myPublish,
    meta: {
      keep: true,
    },
  },
  {
    path: "/my",
    name: "my",
    component: myMy,
  },
  {
    path: "/user",
    name: "user",
    component: User_Edit,
    meta: {
      keep: true,
    },
  },
  {
    path: "/nickedit",
    name: "nickedit",
    component: Nickname_Edit,
  },
  {
    path: "/contact",
    name: "contact",
    component: myContact,
  },
  {
    path: "/about",
    name: "about",
    component: myAbout,
  },
  {
    path: "/forget",
    name: "forget",
    component: myForget,
  },
  {
    path: "/modify",
    name: "modify",
    component: myModify,
  },
  {
    path: "/article",
    name: "article",
    component: myArticle,
  },
];

const router = new VueRouter({
  routes,
});

export default router;
